package utils

const (
	SALT                   = "zenghaifeng"
	SUCCESS                = 200
	ERROR                  = 400
	SUCCESS_CHECK_PASSWORD = 1001
	ERROR_CHECK_PASSWORD   = 1002

	SUCCESS_ADD_USER = 1003
	ERROR_ADD_USER   = 1004

	SUCCESS_TOKEN = 1005
	ERROR_TOKEN   = 1006
)

var codeMsg = map[int]string{
	SUCCESS:                "成功",
	ERROR:                  "失败",
	SUCCESS_CHECK_PASSWORD: "登录成功",
	ERROR_CHECK_PASSWORD:   "密码错误",
	SUCCESS_ADD_USER:       "注册用户成功",
	ERROR_ADD_USER:         "注册用户失败",
}

func GetCodeMsg(code int) string {
	return codeMsg[code]
}

func ReqNew(status int, msg string, data interface{}) map[string]any {

	return map[string]any{
		"status": status,
		"msg":    msg,
		"data":   data,
	}
}
